using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._ModelOnly
{
    /// <summary>
    /// <para>If Field Value Is</para>
    /// <para>Evaluates if the values in an attribute field match a specified value, expression, or second field.</para>
    /// <para>评估属性字段中的值是否与指定的值、表达式或第二个字段匹配。</para>
    /// </summary>    
    [DisplayName("If Field Value Is")]
    public class FieldValueIsIfThenElse : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FieldValueIsIfThenElse()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_data">
        /// <para>Input Data Element</para>
        /// <para>Input element to be evaluated.</para>
        /// <para>要计算的输入元素。</para>
        /// </param>
        /// <param name="_selection_condition">
        /// <para>Selection Condition</para>
        /// <para><xdoc>
        ///   <para>The selection condition to use for the field values of the records matching the SQL expression.</para>
        ///   <bulletList>
        ///     <bullet_item>Exists—Checks if any records match the SQL expression. This is the default.</bullet_item><para/>
        ///     <bullet_item>No Selection—Checks if none of the records match the SQL expression.</bullet_item><para/>
        ///     <bullet_item>All Selected—Checks if all of the records match the SQL expression.</bullet_item><para/>
        ///     <bullet_item>Is Equal to—Checks if the number of records that match the SQL expression is equal to the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Between—Checks if the number of records that match the SQL expression is between the Minimum Count value and Maximum Count value.</bullet_item><para/>
        ///     <bullet_item>Is Less Than—Checks if the number of records that match the SQL expression is less than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Greater Than—Checks if the number of records that match the SQL expression is greater than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Not Equal to—Checks if the number of records that match the SQL expression is not equal to the Count value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于与 SQL 表达式匹配的记录的字段值的选择条件。</para>
        ///   <bulletList>
        ///     <bullet_item>存在 （Exists） - 检查是否有任何记录与 SQL 表达式匹配。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>无选择 （No Selection） - 检查是否有任何记录与 SQL 表达式匹配。</bullet_item><para/>
        ///     <bullet_item>全部选定 （All Selected） - 检查所有记录是否都与 SQL 表达式匹配。</bullet_item><para/>
        ///     <bullet_item>等于- 检查与 SQL 表达式匹配的记录数是否等于 Count 值。</bullet_item><para/>
        ///     <bullet_item>介于两者之间 （Is Between） - 检查与 SQL 表达式匹配的记录数是否介于“最小计数”值和“最大计数”值之间。</bullet_item><para/>
        ///     <bullet_item>小于（Is Less Than） - 检查与 SQL 表达式匹配的记录数是否小于 Count 值。</bullet_item><para/>
        ///     <bullet_item>大于 - 检查与 SQL 表达式匹配的记录数是否大于 Count 值。</bullet_item><para/>
        ///     <bullet_item>不等于 - 检查与 SQL 表达式匹配的记录数是否不等于 Count 值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public FieldValueIsIfThenElse(object _in_data, _selection_condition_value _selection_condition)
        {
            this._in_data = _in_data;
            this._selection_condition = _selection_condition;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "If Field Value Is";

        public override string CallName => "mb.FieldValueIsIfThenElse";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_data, _where_clause, _invert_where_clause.GetGPValue(), _selection_condition.GetGPValue(), _count, _count_min, _count_max, _true, _false];

        /// <summary>
        /// <para>Input Data Element</para>
        /// <para>Input element to be evaluated.</para>
        /// <para>要计算的输入元素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Data Element")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_data { get; set; }


        /// <summary>
        /// <para>Expression</para>
        /// <para>An SQL expression used to select a subset of records. For more information on SQL syntax see SQL reference for query expressions used in ArcGIS.</para>
        /// <para>用于选择记录子集的 SQL 表达式。有关 SQL 语法的详细信息，请参阅 ArcGIS 中使用的查询表达式的 SQL 参考。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _where_clause { get; set; } = null;


        /// <summary>
        /// <para>Invert Where Clause</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the expression will be used as is, or the opposite of the expression will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The query will be used as is. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The opposite of the query will be used. If the Selection Type parameter is used, the reversal of the selection occurs before it is combined with existing selections.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是按原样使用表达式，还是使用与表达式相反的表达式。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 查询将按原样使用。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将使用查询的反面。如果使用“选择类型”参数，则在将选择内容与现有选择组合之前，将发生选择的反转。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Invert Where Clause")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _invert_where_clause_value? _invert_where_clause { get; set; } = null;

        public enum _invert_where_clause_value
        {
            /// <summary>
            /// <para>INVERT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INVERT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NON_INVERT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NON_INVERT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Selection Condition</para>
        /// <para><xdoc>
        ///   <para>The selection condition to use for the field values of the records matching the SQL expression.</para>
        ///   <bulletList>
        ///     <bullet_item>Exists—Checks if any records match the SQL expression. This is the default.</bullet_item><para/>
        ///     <bullet_item>No Selection—Checks if none of the records match the SQL expression.</bullet_item><para/>
        ///     <bullet_item>All Selected—Checks if all of the records match the SQL expression.</bullet_item><para/>
        ///     <bullet_item>Is Equal to—Checks if the number of records that match the SQL expression is equal to the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Between—Checks if the number of records that match the SQL expression is between the Minimum Count value and Maximum Count value.</bullet_item><para/>
        ///     <bullet_item>Is Less Than—Checks if the number of records that match the SQL expression is less than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Greater Than—Checks if the number of records that match the SQL expression is greater than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Not Equal to—Checks if the number of records that match the SQL expression is not equal to the Count value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于与 SQL 表达式匹配的记录的字段值的选择条件。</para>
        ///   <bulletList>
        ///     <bullet_item>存在 （Exists） - 检查是否有任何记录与 SQL 表达式匹配。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>无选择 （No Selection） - 检查是否有任何记录与 SQL 表达式匹配。</bullet_item><para/>
        ///     <bullet_item>全部选定 （All Selected） - 检查所有记录是否都与 SQL 表达式匹配。</bullet_item><para/>
        ///     <bullet_item>等于- 检查与 SQL 表达式匹配的记录数是否等于 Count 值。</bullet_item><para/>
        ///     <bullet_item>介于两者之间 （Is Between） - 检查与 SQL 表达式匹配的记录数是否介于“最小计数”值和“最大计数”值之间。</bullet_item><para/>
        ///     <bullet_item>小于（Is Less Than） - 检查与 SQL 表达式匹配的记录数是否小于 Count 值。</bullet_item><para/>
        ///     <bullet_item>大于 - 检查与 SQL 表达式匹配的记录数是否大于 Count 值。</bullet_item><para/>
        ///     <bullet_item>不等于 - 检查与 SQL 表达式匹配的记录数是否不等于 Count 值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Selection Condition")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _selection_condition_value _selection_condition { get; set; }

        public enum _selection_condition_value
        {
            /// <summary>
            /// <para>Exists</para>
            /// <para>Exists—Checks if any records match the SQL expression. This is the default.</para>
            /// <para>存在 （Exists） - 检查是否有任何记录与 SQL 表达式匹配。这是默认设置。</para>
            /// </summary>
            [Description("Exists")]
            [GPEnumValue("EXISTS")]
            _EXISTS,

            /// <summary>
            /// <para>No Selection</para>
            /// <para>No Selection—Checks if none of the records match the SQL expression.</para>
            /// <para>无选择 （No Selection） - 检查是否有任何记录与 SQL 表达式匹配。</para>
            /// </summary>
            [Description("No Selection")]
            [GPEnumValue("NO_SELECTION")]
            _NO_SELECTION,

            /// <summary>
            /// <para>All Selected</para>
            /// <para>All Selected—Checks if all of the records match the SQL expression.</para>
            /// <para>全部选定 （All Selected） - 检查所有记录是否都与 SQL 表达式匹配。</para>
            /// </summary>
            [Description("All Selected")]
            [GPEnumValue("ALL_SELECTED")]
            _ALL_SELECTED,

            /// <summary>
            /// <para>Is Equal to</para>
            /// <para>Is Equal to—Checks if the number of records that match the SQL expression is equal to the Count value.</para>
            /// <para>等于- 检查与 SQL 表达式匹配的记录数是否等于 Count 值。</para>
            /// </summary>
            [Description("Is Equal to")]
            [GPEnumValue("IS_EQUAL_TO")]
            _IS_EQUAL_TO,

            /// <summary>
            /// <para>Is Between</para>
            /// <para>Is Between—Checks if the number of records that match the SQL expression is between the Minimum Count value and Maximum Count value.</para>
            /// <para>介于两者之间 （Is Between） - 检查与 SQL 表达式匹配的记录数是否介于“最小计数”值和“最大计数”值之间。</para>
            /// </summary>
            [Description("Is Between")]
            [GPEnumValue("IS_BETWEEN")]
            _IS_BETWEEN,

            /// <summary>
            /// <para>Is Less Than</para>
            /// <para>Is Less Than—Checks if the number of records that match the SQL expression is less than the Count value.</para>
            /// <para>小于（Is Less Than） - 检查与 SQL 表达式匹配的记录数是否小于 Count 值。</para>
            /// </summary>
            [Description("Is Less Than")]
            [GPEnumValue("IS_LESS_THAN")]
            _IS_LESS_THAN,

            /// <summary>
            /// <para>Is Greater Than</para>
            /// <para>Is Greater Than—Checks if the number of records that match the SQL expression is greater than the Count value.</para>
            /// <para>大于 - 检查与 SQL 表达式匹配的记录数是否大于 Count 值。</para>
            /// </summary>
            [Description("Is Greater Than")]
            [GPEnumValue("IS_GREATER_THAN")]
            _IS_GREATER_THAN,

            /// <summary>
            /// <para>Is Not Equal to</para>
            /// <para>Is Not Equal to—Checks if the number of records that match the SQL expression is not equal to the Count value.</para>
            /// <para>不等于 - 检查与 SQL 表达式匹配的记录数是否不等于 Count 值。</para>
            /// </summary>
            [Description("Is Not Equal to")]
            [GPEnumValue("IS_NOT_EQUAL_TO")]
            _IS_NOT_EQUAL_TO,

        }

        /// <summary>
        /// <para>Count</para>
        /// <para>The integer count value.</para>
        /// <para>整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count { get; set; } = 0;


        /// <summary>
        /// <para>Minimum Count</para>
        /// <para>The minimum integer count value.</para>
        /// <para>最小整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count_min { get; set; } = 0;


        /// <summary>
        /// <para>Maximum Count</para>
        /// <para>The maximum integer count value.</para>
        /// <para>最大整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count_max { get; set; } = 0;


        /// <summary>
        /// <para>True</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("True")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _true { get; set; }


        /// <summary>
        /// <para>False</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("False")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _false { get; set; }


        public FieldValueIsIfThenElse SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}